//
//  DDGaoGuanCell.m
//  DingDongZP
//
//  Created by FEIYUE on 16/6/12.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDGaoGuanCell.h"

@implementation DDGaoGuanCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.bigView.layer.cornerRadius = 5.f;
    self.bigView.layer.masksToBounds = YES;

}

- (void)updateViewWithData:(DDJobsDetail *)detail{
    
    if (detail) {
        
        self.add.text = detail.city;
        self.year.text = detail.experience;
        self.xueli.text = detail.edu;
        self.price.text = [NSString stringWithFormat:@"¥%@",detail.salary];
        self.zhiWei.text = [NSString stringWithFormat:@"%@",detail.jobtitle];
    }
}

- (void)layoutSubviews{
    
    self.miaoshu.numberOfLines = 0;
    [self.miaoshu sizeToFit];
//    self.miaoshu.frame = CGRectMake(10, 150, [UIScreen mainScreen].bounds.size.width-20, [[self class]heightWithText:self.miaoshu.text]);
    
}

+(CGFloat)heightWithText:(NSString *)text
{
    CGRect rect = [text boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17]} context:nil];
    return rect.size.height;
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
